#ifndef DATAMANGER_H
#define DATAMANGER_H

#include <QObject>
#include <QJsonObject>
#include <QImage>

class QDBService;
class DataManger : public QObject
{
	Q_OBJECT

public:
	DataManger(QDBService * db, QObject *parent = 0);
	~DataManger();

public:
	QJsonObject requestData(const QString & method, const QString & request);

	QImage downloadPicture(const QString & method, const QString & request);
	QJsonObject savePicture(const QString & method, const QByteArray & request);

	QJsonObject select(const QString & SQL);
	QJsonObject execSQL(const QString & SQL);

	QImage downloadPicture(const QString & filePath);
	bool savePicture(const QString & method, const QByteArray & request,QString &msg);

private:
	QDBService * pDbService;
};

#endif // DATAMANGER_H
